package com.sky.mapper;

import com.sky.entity.User;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.time.LocalDateTime;

@Mapper
public interface UserLoginMapper {
    @Select("select * from user where openid=#{openid}")
    User select(String openId);

    /**
     * 插入注册的用户信息
     * @param user
     */
    void insert(User user);

    @Select("select * from user where id=#{userId}")
    User getById(Long userId);

    @Select("select count(*) from user where create_time between #{begin} and #{end} ")
    int addUserCount(LocalDateTime begin, LocalDateTime end);
}
